<template>
	<view class="page page-growth">
		<view class="growth-total flex-row-start">
			<text class="font14">总积分</text>
			<text class="font20 font-b font-theme">{{dataInfo.sum ? dataInfo.sum : 0}}</text>
		</view>
		<LoadMore ref="LoadMore" id="LoadMore" :token="true" :diffHeight="80" :initData="initData" @dataRefresh='dataRefresh' @infoRefresh='infoRefresh'>
			<view class="growth-list">
				<view class="box-shadow growth-item flex-row-between" v-for="(item, index) in dataList" :key="index">
					<view class="left">
						<view class="font15 p1">{{item.msg}}</view>
						<view class="font11 p2">{{item.createtime}}</view>
					</view>
					<view class="right font15 font-ff3c37">{{item.opt == 'add' ? '+' : '-'}}{{item.score}}</view>
				</view>
			</view>
		</LoadMore>
	</view>
</template>

<script>
	import LoadMore from "@/components/j-loadMore/index.vue";
	export default {
		components: { LoadMore },
		data() {
			return {
				dataList: [],
				dataInfo: {},
				// 传参数据
				initData: {
					url: 'score',
					param: {}
				},
			}
		},
		onLoad() {
		},
		methods: {
			// LoadMore返回列表数据
			dataRefresh(e){
				this.dataList = e
			},
			// LoadMore返回列表信息
			infoRefresh(e){
				this.dataInfo = e
			}
		}
	}
</script>

<style lang="less">
	@import url("style.less");
</style>
